//
//  DDTextField.h
//  hnGovernment
//
//  Created by 张辉男 on 17/3/8.
//  Copyright © 2017年 zhn. All rights reserved.
//

#import <UIKit/UIKit.h>

@class DDTextField;
@protocol DDtextfieldDelegate <NSObject>
@optional
- (void)ddtextFieldChangingText:(DDTextField *)textField;
@end

typedef void(^actionBlock)(UITextField *field);
@interface DDTextField : UIView

/**
 文字
 */
@property (nonatomic,copy) NSString *text;

//----- 自定义的属性
@property (nonatomic,assign) CGFloat font;
@property (nonatomic,copy) NSString *placeHolderString;
@property (nonatomic,copy) actionBlock changingAction;
@property (nonatomic,strong) UIColor *textColor;
@property (nonatomic) UIEdgeInsets contentInset;
@property (nonatomic,assign) BOOL isPassword;
@property (nonatomic,assign) BOOL showClearButton;

//------ 代理
@property (nonatomic,weak) id<DDtextfieldDelegate> delegate;

//------
/**
 明文按钮图片
 */
@property (nonatomic,copy) NSString *proclaimedImageName;
/**
 密文按钮图片
 */
@property (nonatomic,copy) NSString *cryptographImageName;
/**
 是否需要切换密文明文状态
 */
@property (nonatomic,assign) BOOL isNeedChangeSecureTextEntry;

/**
 初始化方法

 @param placeHolder placeholder
 @param font 字体大小
 @param textColor 字体颜色
 @param contentInset inset
 @param changingAction 文字改变需要做的操作
 @return ddtextfield
 */
+ (DDTextField *)ddTextFieldWithPlaceHolder:(NSString *)placeHolder Font:(CGFloat)font textColor:(UIColor *)textColor contentInset:(UIEdgeInsets)contentInset textChangingAction:(actionBlock)changingAction;
@end
